package com.zhbit.action;

import java.util.List;

import com.opensymphony.xwork2.ActionSupport;
import com.zhbit.Service.UsermangerService;
import com.zhbit.table.User;

public class SearchresultAction extends ActionSupport{
	private List<User> userlist;
	private UsermangerService us;
	private String userid;
	private String username;
	public void setUs(UsermangerService us) {
		this.us = us;
	}
	public UsermangerService getUs() {
		return us;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getUsername() {
		return username;
	}
	public void setUserid(String userid) {
		this.userid = userid;
	}
	public String getUserid() {
		return userid;
	}
	public void setUserlist(List<User> userlist) {
		this.userlist = userlist;
	}
	public List<User> getUserlist() {
		return userlist;
	}
	public String execute() throws Exception {
	String val=userid+"";
	if(!"".equals(val)){
	int id = Integer.parseInt(userid);
	setUserlist(us.searchresult(id, username));
		
	}
	else{
		int id = Integer.parseInt("0");
		setUserlist(us.searchresult(id, username));
	
	}
	return SUCCESS;
	}
}
